package ezXpns.analysis.aggregators;

import java.util.UUID;

import ezXpns.analysis.Aggregator;


//@author A0088827L
public class Count<T> implements Aggregator<T, Integer> {
	public Count() {
		this(0);
	}
	
	public Count(int initial) {
		acc = initial;
	}

	@Override
	public void addEntry(UUID id, T item) {
		acc += 1;
	}

	@Override
	public void removeEntry(UUID id, T item) {
		acc -= 1;
	}

	@Override
	public Integer getResult() {
		return acc;
	}

	private int acc;
}
